<template>
	<view class="myOrder_box">
		<view class="order_type dis_fx fx_column">
			<view :class="valid==1?'cur':''" @click="tabValid(1)">已生效</view>
			<view :class="valid==0?'cur':''" @click="tabValid(0)">未生效</view>
		</view>
		<view class="person_item">
			<scroll-view scroll-y>
				<view class="item_box">
					<view class="item dis_fx fx_column fx_between" v-for="(item,index) in userList">
						<view class="person_info dis_fx fx_column">
							<view class="fz_0"><image :src="item.headSculpture"></image></view>
							<text>{{item.username}}</text>
						</view>
						<view class="date">{{item.registerTime}}</view>
					</view>
					
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import util from '../../../common/util.js'
	export default {
		data() {
			return {
				userList:[],
				valid:1,
				page:1,
				rows:10
			}
		},
		onLoad(){
			this.getStream()
		},
		methods: {
			tabValid(valid){
				this.valid=valid
				this.page=1
				this.getStream()
			},
			//获取二级成员信息
			getStream(){
				uni.showLoading({
					mask:true,
					title: '加载中'
				});
				var that=this;
				var params={
					valid:that.valid,
					page:that.page,
					rows:that.rows
				}
				util.fetchPost('/user/secondRecommends',params,function(res){
					that.userList=res.data
					uni.hideLoading();
				},function(){},true)
			},
		}
	}
</script>

<style>
	.myOrder_box{
		height: 100%;
	}
	.myOrder_box .order_type>view{
		flex: 1;
		font-size: 28upx;
		color: #999999;
		text-align: center;
		line-height: 100upx;
	}
	.myOrder_box .order_type>view.cur{
		color: #FFC800;
		font-size: 32upx;
		font-weight: 600;
		position: relative;
	}
	.myOrder_box .order_type>view.cur::after{
		content: '';
		position: absolute;
		bottom: 10upx;
		background: #FFC800;
		width: 60upx;
		height: 5upx;
		left: 50%;
		margin-left: -30upx;
	}
	.person_item{
		height: calc(100% - 100upx);
	}
	scroll-view{
		height: 100%;
	}
	.person_item .item_box{
		padding: 0 24upx 24upx;
	}
	.person_item .item{
		border-bottom: 1px solid #EAEAEA;
		padding: 40upx 0;
	}
	.person_item image{
		width: 80upx;
		height: 80upx;
		border-radius: 50%;
	}
	.person_item text{
		font-size: 32upx;
		color: #333;
		margin-left: 30upx;
		font-weight: 600;
	}
	.person_item .date{
		font-size: 28upx;
		color: #999999;
	}
</style>
